import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/components/Index'
import overview from '@/components/overview'
import overview2 from '@/components/overview2'
import set from '@/components/set'
import warnSet from '@/components/warnSet'


//恒湿机首页
import Humi from '@/components/Interface/Humi'
import Deac from '@/components/Interface/deac'



Vue.use(Router)

// 解决路由跳转多次点击报错问题
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
   return originalPush.call(this, location).catch(err => err)
}

export default new Router({
  // mode:'history',//  路径去除/方法
  routes: [
    // 5.0首页
    {
      path: '/',
      name: 'Index',
      component: Index,
      meta: {

        keepAlive: true

      },
    }, 
    {
      path: '/Index',
      name: 'Index',
      component: Index
    }, 
    {
      path:'/Humi',
      name:'Humi',
      component:Humi
    },
    {
      path:'/Deac',
      name:'Deac',
      component:Deac
    },
    {
      path: '/overview',
      name: 'overview',
      component: overview,
      meta: {
        requireAuth: true // 配置此条，进入页面前判断是否需要登陆 
      }
    }, 
    {
      path: '/overview2',
      name: 'overview2',
      component: overview2
    }, 
    {
      path: '/set',
      name: 'set',
      component: set,
    }, 
    {
      path: '/warnSet',
      name: 'warnSet',
      component: warnSet,
      meta: {
        requireAuth: true // 配置此条，进入页面前判断是否需要登陆 
      }
    }, 
  ]
})



